#ifndef QTHTTP_C
#define QTHTTP_C

#ifdef __cplusplus
//extern "C"{
#endif

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>

int webget(const char* url,char* result){
    QByteArray rst;
    QNetworkRequest request;
    request.setUrl(QUrl(url));

    QNetworkAccessManager *manager = new QNetworkAccessManager(this);
    QNetworkReply *reply = manager->get(request);

    rst = reply->readAll();

    if(rst.size()<0)
        return -1;
    else
        result = rst.data();
    //return reply->readAll();
    //connect(_networkManager,SIGNAL(finished(QNetworkReply*)),this,SLOT(replyFinished(QNetworkReply*)));

}

#ifdef __cplusplus
//}
#endif

#endif // QTHTTP_C
